Reminder - Bookable Slots

Don’t forget that you can book time to see me.

Slots are available at

  • 1:00, 1:30 and 2:00 every Tuesday
  • 11:30, 12:00 and 12:30 every Wedneday

Slots are currently available up until the second week of June.

Pop me a message if you can’t make those times and we can work something out.

Useful Tools - Notebook LM

What is NotebookLM?

Notebook LM is a Google product that allows you to pass in specfic sources that will be used by a generative AI model.

You can feed it a range of sources, including

  • Google slides
  • Youtube videos
  • webpages

(Thanks to Joel for originally making me aware of this tool)

Why might NotebookLM be useful to you?

Because it can be trained on specific sources, you can use it to remind yourself of the HSMA way of doing things.

A note about code

Notebook LM has the really nice feature of actually referring back to the source it’s used

But in code, that means you get the sources appearing in [] in a way that would break the code…

Other Features

The ‘deep dive’ feature is a way to get a good summary of complex information like scientific papers.

It generates a podcast!

Things to note

  • Don’t put anything private/sensitive in there!
    • They say it’s not reviewed by humans or used to train models… but still…
  • You can’t share your notebook if you don’t have a paid Google AI plan (which is a shame if you’re working in a team)
    • it will look like sharing is available, but it doesn’t work…
  • Websites (like the DES book) need to be added page-by-page
    • quite tedious!
    • this also means you might quickly hit the free plan limit of 50 sources per notebook

Automated Documentation Generation with Generative AI

The Tool

This repository contains a script to automatically generate documentation from a codebase.

[https://github.com/The-Pocket/PocketFlow-Tutorial-Codebase-Knowledge](https://github.com/The-Pocket/PocketFlow-Tutorial-Codebase-Knowledge]

It’s designed to write beginner-friendly documentation with loads of analogies and clear breakdowns of what is going on.

Why is this useful?

Documentation is the thing no-one wants to do…

And it always goes out of date!

In addition, if you’re trying to work with someone else’s code, it can be really hard to get your head around how everything is done.

Example page

How does it do this?

The framework

  • reads all of the files in the GitHub repository (or you can tell it to focus on only certain files or file types)
  • passes this to your chosen LLM, which decides how best to split them up into chapters
  • passes the chapter details to the LLM, which then writes several chapters in markdown format

(I’ve then been converting the output into Quarto for easy integration with existing documentation)

Code Examples

It generates code examples…

Diagrams

And diagrams…

Prompt Editing

Because of the way this code is designed, you can modify the prompt that gets fed in.

It just lives in text in the nodes.py file.

Custom Documentation

So you can ask it to make the documentation more or less beginner friendly, or add very specific requests.

Considerations

Anything you feed into this may be fair game for model training.

And you certainly don’t want to feed in anything that needs to remain private!

But if your repository is already open-source, then you may wish to consider it.

Cost

Google’s most advanced model (gemini-2.5-pro-exp-03-25) is currently free for roughly 25 requests a day.

For me, that was enough to generate two sets of documentation per day before hitting the limit.

Further Info

I’ll put together a quick guide on the ‘how’ in the next few days, but if you’re keen to try it out sooner, have a go at following the instructions in the repository readme (and message me if you get stuck).

Working on your DES Projects

Getting distributions from real data

Event Logging

An Intro to Process Analytics with BupaR - and why it can help your DES project!

A Little on Verification and Validation of DES Models

Work In Progress - an alternative approach to boundary optimization

Why is Boundary Optimization more complex?

  • Compared to sites, where you can have any combination… (though they won’t all be sensible)

Boundaries have to make sense…

So how would we build up a new candidate combination?

Let’s play a game

Let’s add more players

How do we do this?

LSOAs (or any other geography) have a concept of neighbours (something sharing a border)

Here, we start with a territory that’s pretty central in the existing territories

  • we could choose a random cell from the existing territory
  • or completely at random
  • or we could have a different number of players to our existing territory

The game

On each step, it

  • rolls a dice to decide if it will take part in this round
  • chooses a neighbour at random from the list of neighbours
    • if no-one already owns the neighbour, it takes ownership
    • if someone does already own it, it takes no territory on that turn

This randomness ensures we don’t end up with every player owning the same number of units of territory each time.

Assessing the solutions

We can then generate multiple allocations, which will all (probably) differ.

We can then score each solution on a metric - here, we’re trying to minimize the difference in received calls across each region, so we work out the average across all regions and then work out the absolute difference.

The closer the resulting value is to zero, the better the solution is.

Making the solutions better

Rather than just randomly generating thousands of candidate solutions, we may move to a better solution faster by varying the best random solutions.

With some more boundary logic, we can create new possible solutions that are a variation on our best solution from the previous step.

Evaluating our evolution

We then evaluate again.

And on and on!

And - in theory - we’d keep going for a set number of generations or a defined amount of compute time - and see how good a solution we can come up with!

Why do I think this is worth doing?

  • It’s a relatively intuitive method compared to some of the other theoretical approaches (I think…?)
  • The resulting boundaries can be made to follow some sort of recognised/logical existing boundaries, which can be practical in reality

Current Issues

  • Slow…
  • Doesn’t have an end-to-end process (yet)
  • Some of the generated territories are impractical in reality (e.g. long and thin protrusions)
  • Shouldn’t this already be a solved problem…?

Planned next steps

  • Make it more efficient
  • Implement multi-objective optimisation
    • in reality, you might want to optimize on a balance of multiple things, like
      • average travel time
      • max travel time
      • average deprivation scores(?)
      • how ‘compact’ the resulting territory is
  • Make it into a library?
  • Find people who might have a problem we can test it out on!

New Streamlit Features

Streamlit 1.44 adds more theming options

Version 1.44 Release Notes

What can you change now?

A lot more than before!

Custom Fonts

Custom fonts appear to be supported via downloaded font files